#include "widget.h"
#include <QApplication>
#include <QTextCodec>
#include <QObject>
#include <QWSServer>
#include <QTimer>
#include <QFile>
#include"configargs.h"
#include <QDebug>
#include <QDir>

//#define QT_NO_QWS_CURSOR
int DebugOrRelease;




int main(int argc, char *argv[])
{
	QApplication::addLibraryPath("/opt/qtenv/QT-4.8.2-arm/plugins");  //添加插件,用于显示jpg,gif等图
	

    QApplication a(argc, argv);
    DebugOrRelease=0;
//	QApplication::setOverrideCursor(Qt::ArrowCursor);  //设置默认鼠标
	QApplication::setOverrideCursor(Qt::BlankCursor);  //隐藏鼠标

	
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

	QFont font;
	QFile filecmd("/proc/cmdline");
	filecmd.open(QIODevice::ReadOnly);
	g_cmdline = filecmd.readAll();

	if(g_cmdline.contains("480x272"))
	{
		font.setFamily("wenquanyi");
		font.setPointSize(50);
		font.setBold(false);
	}else{
		
	    font.setPointSize(17);
	    font.setFamily("BENMO Jingyuan Regular");
	    font.setBold(false);
   }

	a.setFont(font);
	filecmd.close();

    Widget w;
 //   w.setCursor(Qt::CrossCursor);
    if (DebugOrRelease) {
        QWSServer::setCursorVisible(true);
        w.setCursor(Qt::CrossCursor);
    }else
    	QWSServer::setCursorVisible(false);

    w.show();
    return a.exec();
}
